<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户管理系统</title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>用户管理系统</h1>
            <p>基于Spring Boot的RESTful API演示</p>
        </header>

        <main>
            <!-- 用户表单 -->
            <section class="form-section">
                <h2 id="form-title">创建用户</h2>
                <form id="user-form">
                    <input type="hidden" id="user-id" name="id">
                    
                    <div class="form-group">
                        <label for="username">用户名：</label>
                        <input type="text" id="username" name="username" required 
                               minlength="3" maxlength="20" 
                               placeholder="3-20个字符">
                        <span class="error-message" id="username-error"></span>
                    </div>

                    <div class="form-group">
                        <label for="email">邮箱：</label>
                        <input type="email" id="email" name="email" required 
                               placeholder="example@email.com">
                        <span class="error-message" id="email-error"></span>
                    </div>

                    <div class="form-group">
                        <label for="password">密码：</label>
                        <input type="password" id="password" name="password" required 
                               minlength="6" placeholder="至少6个字符">
                        <span class="error-message" id="password-error"></span>
                    </div>

                    <div class="form-actions">
                        <button type="submit" id="submit-btn">提交</button>
                        <button type="button" id="reset-btn">重置</button>
                        <button type="button" id="cancel-edit-btn" style="display: none;">取消编辑</button>
                    </div>
                </form>
            </section>

            <!-- 用户列表 -->
            <section class="list-section">
                <h2>用户列表</h2>
                <div class="list-header">
                    <button type="button" id="refresh-btn">刷新列表</button>
                    <div id="loading" class="loading" style="display: none;">加载中...</div>
                </div>
                <div id="user-list" class="user-list">
                    <!-- 用户列表将动态加载到这里 -->
                </div>
            </section>

            <!-- 消息提示 -->
            <div id="message" class="message" style="display: none;"></div>
        </main>
    </div>

    <script src="/static/js/app.js"></script>
</body>
</html>


